<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>   
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="shortcut icon" href="<?=$this->templateUrl()?>/img/favicon.ico" type="image/x-icon" />
	<title><?=$this->title?></title>
	<?=$this->includeLibs()?>
	
   </head>
<body>
    <?php
             $protectedPages = mysql_query("SELECT * FROM `page` WHERE protected = 1 AND group_id =" . $_SESSION['groupId']);      

    ?>
<div id="wrapper">  	
    <!-- header -->
	<header id="header">
    		<hgroup>
        		<h1 class="site_title"><a href="<?=$this->baseUrl()?>/admin">Protestantse Gemeente Schagen - Administrator Paneel</a></h1>
        		<div class="header_logo"></div>
                
    		</hgroup>
	</header>
<!-- sidebar top -->
	<section id="secondary_bar">
    		<div class="user">
        		<p>U bent ingelogd als <?=$_SESSION['username']?></p> 		
    		</div>
</section>
<!-- sidebar menu -->
<aside id="sidebar" class="column">
    <?php if($_SESSION['isAdmin'] == "1"){ ?>
    <h3>Algemeen</h3>
     <ul class="toggle" id="abc">
     <li class="icn_edit_article">
        <a href="<?=$this->baseUrl()?>/administrator/">
            <div class="menuimg">
                    <img src="<?=$this->templateUrl()?>/images/back/home.png" height="36px" width="36px"/>
                </div>
                <div class="menutext">Home</div>
        
        </a>
    </li>  
</ul>
    <h3>Bewerken / Toevoegen</h3>
    <ul class="toggle" id="abc">
    <li class="icn_edit_article">
    	<a href="<?=$this->baseUrl()?>/administrator/editpage?id=3">
        	<div class="menuimg">
                	<img src="<?=$this->templateUrl()?>/images/back/edit.png" height="36px" width="36px"/>
                </div>
                <div class="menutext">Pagina Bewerken</div>
       	
        </a>
   	</li>  
        <li class="icn_edit_article">
        		<a href="<?=$this->baseUrl()?>/administrator/addpage">
        		 	<div class="menuimg">	
        		<img src="<?=$this->templateUrl()?>/images/back/edit_add.png" height="36px" width="36px" />
        			</div>
        		<div class="menutext">
        			Pagina Toevoegen</div>
        		</a>
        	</li>  
        <li class="icn_edit_article"> <a href="<?=$this->baseUrl()?>/administrator/bookings"><div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/church.png" height="36px" width="36px" />
        </div><div class="menutext">Reserveringen</div></a></li>
    </ul>
    
    <h3>Media Toevoegen</h3>
    <ul class="toggle">
        <li class="icn_video"><a href="#" onClick="MyWindow=window.open('http://www.gerendineke.nl/template/js/kcfinder/browse.php?type=images&CKEditor=content&CKEditorFuncNum=2&langCode=nl','MyWindow','toolbar=no,location=no,directories=yes,status=no,menubar=yes,scrollbars=yes,resizable=no,width=800,height=500'); return false;">
        <div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/file_format_jpg.png" height="36px" width="36px" />
        </div>
        <div class="menutext">Afbeeldingen</div>
        </a>
        </li>     
        
	<li class="icn_new_article"><a href="#" onClick="MyWindow=window.open('http://www.gerendineke.nl/template/js/kcfinder/browse.php?type=files&CKEditor=content&CKEditorFuncNum=2&langCode=nl','MyWindow','toolbar=no,location=no,directories=yes,status=no,menubar=yes,scrollbars=yes,resizable=no,width=800,height=500'); return false;">
	<div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/document1.png" height="36px" width="36px" />
	</div>
	<div class="menutext">Documenten</div>
	</a>
	</li>
	
	<li class="icn_new_article"><a href="<?=$this->baseUrl()?>/administrator/announcements?result=false">
        <div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/envelope.png" height="36px" width="36px" /></div>
        <div class="menutext">Mededelingen</div>
        </a>
        </li>
    </ul>   
     
    <h3>Opties</h3>
    <ul class="toggle">
        <li class="icn_profile"><a href="<?=$this->baseUrl()?>/administrator/adduser">
        <div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/group.png" height="36px" width="36px" />
        </div>
        <div class="menutext">Gebruikers</div>
        </a>
       </li>
       
        <li class="icn_profile"><a href="<?=$this->baseUrl()?>/administrator/groups">
        <div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/group.png" height="36px" width="36px" />
        </div>
        <div class="menutext">Groepen</div>
        </a>
        </li>
        <li class="icn_profile"><a href="<?=$this->baseUrl()?>">
        <div class="menuimg"><img src="<?=$this->templateUrl()?>/images/back/help.png" height="36px" width="36px" />
        </div>
        <div class="menutext">Help</div>
        </a>
        </li>       
    </ul>
    <?}else{ 
     print "<h3>Beveiligde pagina's</h3>";   
         while ($row = mysql_fetch_array($protectedPages)) {
             
            print "<li class='icn_profile'><a href=" . $this->baseUrl() . "/administrator/protectedpage?id=" . $row['id'] ." target='_blank'>
                <div class='menuimg'><img src='" . $this->templateUrl() . "/images/back/document1.png' height='36px' width='36px'/>
                </div>
                <div class='menutext'>" . $row['name'] . "</div>
                </a>
            </li>";    
         }
     }?>
      <li class="icn_settings"><a href="<?=$this->baseUrl()?>/login?logout=true">
        <div class="menuimg>"<img src="<?=$this->templateUrl()?>/images/back/close.png" height="36px" width="36px" />
        </div>
        <div class="menutext">Uitloggen</div>
        </a>
        </li>
</aside>
    <div id="admin_mid">
	   <section id="main" class="content">
	   	<?=$this->loadView()?>
	   </div>	
    </div>
    <div id="footer">
    </div>
</div>
 
</body>
</html>
